﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace GameStateManagement
{
    class GameOverScreen : MenuScreen
    {
        public GameOverScreen()
            : base("GameOver")
        {

            MenuEntry retryMenuEntry = new MenuEntry("Retry");
            MenuEntry quitMenuEntry = new MenuEntry("Quit to Main Menu");

            retryMenuEntry.Selected += RetryMenuEntrySelected;
            quitMenuEntry.Selected += QuitMenuEntrySelected;

            MenuEntries.Add(retryMenuEntry);
            MenuEntries.Add(quitMenuEntry);
        }

        void RetryMenuEntrySelected(object sender, EventArgs e)
        {
            // Close this screen (clean everything up)
            this.ExitScreen();

            LoadingScreen.Load(ScreenManager, false, new BackgroundScreen(), new GameplayScreen());
        }

        void QuitMenuEntrySelected(object sender, EventArgs e)
        {
            LoadingScreen.Load(ScreenManager, false, new BackgroundScreen(),
                                                     new MainMenuScreen());
            
        }
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 2 / 3);

            base.Draw(gameTime);
        }
    }
}
